package com.rainbow.config;

import feign.Request;
import feign.Retryer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class FeignConfig {
    public static int connectTimeOutMillis = 1000;//超时时间
    public static int readTimeOutMillis = 1000;
    @Bean
    public Request.Options options() {
        return new Request.Options(connectTimeOutMillis, readTimeOutMillis);
    }

    //自定义重试次数
    @Bean
    public Retryer feignRetryer() {
        return Retryer.NEVER_RETRY;
    }
}